<script type="text/javascript">
    
    function agentPasswordResponse(response) {
	if (response.responseText == "true") {
            $('agentPasswordStatus').innerHTML = okString;
            $('nextTabButton').disabled = false;
	} else {
            $('agentPasswordStatus').innerHTML = errorImage +
                '<small>' + response.responseText + '</small>';
            $('nextTabButton').disabled = true;
	}      
    }
        
    function validateAgentPasswords() {        
        var link = "?actionLink=checkPasswords";        
        var cValue = "confirm=" + encodeURIComponent($('agentConfirm').value);
        var aValue = "&password=" + encodeURIComponent($('agentPassword').value);
        var oValue = "&otherPassword=" + encodeURIComponent($('adminConfirm').value);
        var type = "&type=agent";
        ie7fix++;
        AjaxUtils.doPost(null, "$context$path" + link + "&ie7fix=" + ie7fix,
            cValue + aValue + oValue + type, agentPasswordResponse, null, null);
    } 

    function initStep6() {
        $('nextTabButton').disabled = true;
    }
    YAHOO.util.Event.onDOMReady(initStep6);
</script>

<div style="margin-left:10px;">
    <h1>$page.getLocalizedString("agent.step.title")<img class="pointer" src="$context/assets/images/message.gif"/></h1>
    <p>$page.getLocalizedString("agent.step.description")</p>
    
    <div class="summaryPanel" style="width:570px">
        <p id="allfields"><em>*</em>&nbsp;$page.getLocalizedString("required.field.label")</p>
        <b class="xtop"><b class="xt1"></b><b class="xt2"></b><b class="xt3"></b><b class="xt4"></b></b>
        <div class="headerBox">$page.getLocalizedString("agent.step.subtitle")</div>
        <div class="bodyBox"  style="height:180px">
            <span>
                <table class="temp">
                    <tr>
                        <td colspan="2">
                            <b>$page.getLocalizedString("agent.user.name")</b>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <em>&nbsp;*&nbsp;</em>$page.getLocalizedString("password.label")
                        </td>
                        <td>
                            <input id="agentPassword" name="agentPassword" 
                                   type="password" value="" class="text"
                                   onkeyup="APP.callDelayed(this,validateAgentPasswords)"
                                   onchange="APP.callDelayed(this,validateAgentPasswords)">                            
                            <span id="agentPasswordStatus"></span>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <em>&nbsp;*&nbsp;</em>$page.getLocalizedString("confirm.label")
                        </td>
                        <td>
                            <input id="agentConfirm" name="agentConfirm" 
                                   type="password" value="" class="text" 
                                   onkeyup="APP.callDelayed(this,validateAgentPasswords)"
                                   onchange="APP.callDelayed(this,validateAgentPasswords)"/>                            
                        </td>
                    </tr>
                </table> 
            </span>
        </div>
        <b class="xbottom">
            <b class="xbGray1"></b>
            <b class="xbGray2"></b>
            <b class="xbGray3"></b>
            <b class="xbGray4"></b>
        </b>
    </div>
</div>
